﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace QLCF.Forms
{
    public partial class popupSetQuantity : Form
    {
        private frmTableService frmTbS1 = null;
        private int billDetailID;
        public popupSetQuantity()
        {
            InitializeComponent();
        }
        public popupSetQuantity(frmTableService m_frmTableService, int m_billDetailID,string pName, string unit, double quantity)
        {
            InitializeComponent();
            frmTbS1 = m_frmTableService;
            billDetailID = m_billDetailID;
            lblProductName.Text = pName;
            lblUnit.Text = unit;
            numQuantity.Value =Convert.ToDecimal(quantity);
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btnOk_Click(object sender, EventArgs e)
        {
            if (numQuantity.Value <= 0)
                MessageBox.Show("Số lượng phải >0");
            else
            {
                frmTbS1.updateQuantity(billDetailID, (double)(numQuantity.Value));
                this.Close();
            }
        }
    }
}
